<HTML><HEAD><TITLE>tent_set_random(?Vars, ++Values)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(tentative)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>tent_set_random(?Vars, ++Values)</H1>
Set the tentative value of each variable within Vars to a random value from the given Range
<DL>
<DT><EM>Vars</EM></DT>
<DD>A term
</DD>
<DT><EM>Values</EM></DT>
<DD>Specification of possible values
</DD>
</DL>
<H2>Description</H2>

	Assign to each variable in Vars a random value from the given
	specification of possible values.  The Values specification can be
	<DL>
	<DT>Min..Max</DT>
	    <DD>A range of integers from Min to Max</DD>
	<DT>List</DT>
	    <DD>A list of possible values</DD>
	<DT>Array</DT>
	    <DD>An array of possible values</DD>
	</DL>
    
<H3>Modes and Determinism</H3><UL>
<LI>tent_set_random(?, ++) is det
</UL>
<H2>Examples</H2>
<PRE>
    ?- length(L, 5), tent_set_random(L, 1 .. 9).
    L = [Xi{2 -&gt; 0}, Xi{3 -&gt; 0}, Xi{7 -&gt; 0}, Xi{5 -&gt; 0}, Xi{3 -&gt; 0}]
    Yes (0.00s cpu)

    ?- length(L, 5), tent_set_random(L, [a, e, i, o, u]).
    L = [Xi{o -&gt; 0}, Xi{e -&gt; 0}, Xi{o -&gt; 0}, Xi{e -&gt; 0}, Xi{e -&gt; 0}]
    Yes (0.00s cpu)

    ?- length(L, 5), tent_set_random(L, [](a, e, i, o, u)).
    L = [Xi{u -&gt; 0}, Xi{i -&gt; 0}, Xi{a -&gt; 0}, Xi{o -&gt; 0}, Xi{a -&gt; 0}]
    Yes (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/tentative/tent_set-2.html">tent_set / 2</A>, <A HREF="../../lib/tentative/tent_set_all-2.html">tent_set_all / 2</A>
</BODY></HTML>
